package com.un.ebs.customer.mapper;

import com.baomidou.mybatisplus.annotation.SqlParser;
import com.un.ebs.customer.domain.CustomerExt;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Component;

/**
 * <p>
 * 1 Mapper 接口
 * </p>
 *
 * @author liubo
 * @since 2020-05-12
 */
@Component
public interface CustomerExtMapper extends BaseMapper<CustomerExt> {

    /**
     * 按手机号码查询客户信息，不自动按租户过滤
     *
     * @param mobile
     * @return
     */
    @SqlParser(filter = true)
    @Select("select * from v_customer_ext where phone=#{phone} or other_phone=#{phone}")
    CustomerExt selectByMobile(@Param("mobile") String mobile);
}
